package com.gem.utils;

import io.netty.channel.Channel;

import java.net.InetSocketAddress;

/**
 * @description:
 * @Author: Xhy
 * @gitee: https://gitee.com/XhyQAQ
 * @copyright: B站: https://space.bilibili.com/152686439
 * @CreateTime: 2023-07-08 10:46
 */
public class IPUtils {

    public static String getIp(Channel channel){
        InetSocketAddress ipSocket = (InetSocketAddress)channel.remoteAddress();
        final String ip = ipSocket.getAddress() +":" +ipSocket.getHostName() ;
        return ip;
    }
}
